import 'package:flutter/material.dart';

class ExpenseCategory extends StatelessWidget {
  final List<Map<String, dynamic>> categories = [
    {'name': 'Groceries', 'amount': 516, 'percent': 35.0},
    {'name': 'Holidays', 'amount': 358, 'percent': 24.0},
    {'name': 'Presents', 'amount': 211, 'percent': 14.0},
  ];

  @override
  Widget build(BuildContext context) {
    return Column(
      children: categories.map((category) {
        return ListTile(
          title: Text(category['name']),
          subtitle: LinearProgressIndicator(
            value: category['percent'] / 100,
            backgroundColor: Colors.grey[300],
            valueColor: AlwaysStoppedAnimation<Color>(Colors.orange),
          ),
          trailing: Text("€${category['amount']}"),
        );
      }).toList(),
    );
  }
}
